Skip to content

feat(profile): signed scope/RoE + verifiedScope for Pillar 3 (Pillar 4 step 5) - #298

Merged
sandstream merged 1 commit into
mainfrom
claude/web-kit-status-sync-p6fg9a
Jul 9, 2026
Merged

sandstream merged 1 commit into
mainfrom
claude/web-kit-status-sync-p6fg9a

Conversation

@sandstream

Copy link
Copy Markdown
Owner

Description

The marquee step of the traveling project profile (Pillar 4): make the profile's [scope]/RoE a cryptographically attributable, offline-verifiable artifact, and expose it fail-closed for Pillar 3's exec-broker. Reuses kit's existing signing floor verbatim — zero new crypto.

Type of Change

  • New feature (non-breaking change that adds functionality)

Related Issues

Changes Made

  • src/profile/sign.ts:
    • signProfile — signs canonicalProfileBytes (generated excluded) through the resolved keystore, exactly like kit policy sign: a hardware-rooted backend can sign, and a hardware mandate (KIT_REQUIRE_HARDWARE_IDENTITY / policy require_hardware_identity) is enforced via assertHardwareIdentity. Writes .kit-profile.sig (reusing the PolicySignature record shape).
    • verifyProfileSignature — identical trust order and revocation semantics to verifyPolicy: --key pin → local identity → org anchor (.kit-policy.signers); fail-closed once an anchor is present.
    • verifiedScope — the fail-closed hook for Pillar 3's exec-broker: returns the [scope] only when the signature is valid. Unsigned / changed / forged / revoked-signer / no-scope all return null (grant nothing).
  • src/commands/profile.ts — kit profile sign + kit profile verify (--key, --json), mirroring kit policy verify's fail-open-on-trust-absence exit semantics.
  • src/cli.ts — updated profile help + SUBCOMMAND_HELP for sign/verify.
  • contracts/public-surface.json — regenerated for the new help keys.
  • src/profile/sign.test.ts — 9 tests via a throwaway KIT_IDENTITY_DIR: sign→verify (local), refuse-no-profile, unsigned, tamper-detection, re-sign restores validity, and verifiedScope fail-closed across unsigned / tampered / no-scope.

Testing

Test Coverage

  • Added new tests (9)
  • Updated existing tests (regenerated public-surface.json)
  • All tests pass (npm test) — full suite 2649 pass / 0 fail (2640 baseline + 9)

Manual Testing

  1. npx tsc --noEmit → clean.
  2. npx eslint src → 0 errors.
  3. npm run build && node scripts/gen-public-surface.mjs && node scripts/test.mjs → 2649 pass, 0 fail.
  4. npx prettier --check → formatted.

Breaking Changes

None / N/A — new subcommands + module.

Checklist

  • My code follows the project's style guidelines
  • All new code has test coverage
  • All tests pass locally (npm test)
  • No new warnings or errors introduced
  • No hardcoded secrets or sensitive data — signs a declaration of backend selection + scope, never secret values
  • Code has been self-reviewed

Performance Impact

  • No performance impact

Reviewer Notes

The security-critical property is verifiedScope's fail-closed contract: an autonomous agent's permissions (egress allowlist, fs-scope, secret-scope) must come only from a valid, attributable signature — an unsigned or hand-edited [scope] grants nothing. This is the seam Pillar 3's exec-broker will consume. Signing is deliberately routed through the keystore (not the file key directly) so the same hardware mandate that protects the org policy protects the RoE. What remains in the profile track is step 4 (plugin/workflow discovery so those kinds stop being "unaudited", plus kit triage plugin and vault-config triage) — orthogonal to signing.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2


Generated by Claude Code

…4 step 5)

Makes the profile's [scope]/RoE a cryptographically attributable, offline-verifiable
artifact by reusing kit's existing signing floor verbatim (design:
pillar4-traveling-profile-5.0.md §4.4). Adds src/profile/sign.ts:

- signProfile: signs canonicalProfileBytes (generated excluded) through the resolved
  keystore — same path as 'kit policy sign', so a hardware-rooted backend can sign and a
  hardware mandate (KIT_REQUIRE_HARDWARE_IDENTITY / require_hardware_identity) is enforced.
  Writes .kit-profile.sig (PolicySignature shape).
- verifyProfileSignature: same trust order and revocation semantics as verifyPolicy —
  --key pin → local identity → org anchor (.kit-policy.signers); fail-closed once anchored.
- verifiedScope: the fail-closed hook for Pillar 3's exec-broker — returns the [scope] ONLY
  when the signature is valid. Unsigned / changed / forged / revoked-signer / no-scope → null.

Wires 'kit profile sign' + 'kit profile verify' (--key, --json). No new crypto — a second
consumer of the verified floor. 9 tests (sign→verify, tamper-detection, re-sign restores,
verifiedScope fail-closed across unsigned/tampered/no-scope). public-surface.json regenerated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

✅ Docker image built successfully

  • CLI image: docker.io/sandstream/kit:test

@sandstream
sandstream merged commit 5e4ee4e into main Jul 9, 2026
18 checks passed
@sandstream
sandstream deleted the claude/web-kit-status-sync-p6fg9a branch July 9, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants